<?php
namespace Home\Controller;
use Think\Controller;
class ShareController extends Controller {
    public function index(){
    	$jsapi_ticket = getJsApiTicket();
    	$nonceStr = createNonceStr();
    	$url='http://'.$_SERVER['SERVER_NAME'].__SELF__;
    	$timestamp = time();
    	$string1 = "jsapi_ticket=".$jsapi_ticket."&noncestr=".$nonceStr."&timestamp=".$timestamp."&url=".$url;
    	$signature = sha1($string1);
    	$data = array(
    		'appid'=>APPID,
    		'timestamp'=>$timestamp,
    		'nonceStr'=>$nonceStr,
    		'signature'=>$signature,
    		'url'=>$url,
    	);
    	$this->assign($data);
        $this->display();
    }
}